<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <style>
        table {
            border: 1px solid rgb(182, 179, 179);
            width: 1500px;
        }

        #div1 {
            width: 1500px;
            height: 30px;
            background: #f1aaaa;
        }

        #btn1 {
            margin-left: 720px;

        }
    </style>
    <table>
        <thead>
            <tr>
                <th>姓名</th>
                <th>性别</th>
                <th>年龄</th>
                <th>电话</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody id="tb">
        </tbody>

    </table>
    <div id="div1"><button id="btn1" onclick="fun()">添加</button></div>
    <br>
    <button id="btn2">搜索</button>
</body>
<script>
    var kong = ``

    function fun() {
        var tth = document.getElementById('tb')
        var kong = `
            <tr>
                <th><input type="text"></th>
                <th><input type="text"></th>
                <th><input type="text"></th>
                <th><input type="text"></th>
                <th><button onclick = "fu(this)">删除</button></th>
            </tr>
             `
        document.getElementById('tb').innerHTML += kong
    }
    var thio = document.getElementById('tbo')

    function fu(thio) {
        var shan = thio.parentNode.parentNode.parentNode
        var chu = thio.parentNode.parentNode
        shan.removeChild(thio.parentNode.parentNode)
    }

    
</script>

</html>